<template>
  <div>
    <hpro-help :desc="desc"></hpro-help>

    <el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
      <el-tab-pane label="总体数据" name="statistic"></el-tab-pane>
      <el-tab-pane label="送出数据" name="plus"></el-tab-pane>
      <el-tab-pane label="消耗数据" name="minus"></el-tab-pane>
      <el-tab-pane label="积分流水明细" name="detail"></el-tab-pane>
    </el-tabs>

    <router-view/>
  </div>
</template>

<script>
export default {
  data () {
    return {
      desc: [
        '会员积分是维系会员忠诚度的重要工具，可以通过消费送积分、活动送积分等规则，让会员累积自己的消费积分',
        '配合积分抵扣、低分兑换等营销、促销手段，促使客户回店',
        '美味智慧云提供了多种维度的积分数据展示，供运营人员查看，也可以将这些数据导出excel，做更加个性化的分析'
      ],
      activeName: 'statistic'
    }
  },
  created () {
    this.checkActiveName()
  },
  methods: {
    handleTabClick () {
      let activeName = this.activeName
      this.$router.push({
        path: activeName,
        query: {
          type: activeName
        }
      })
    },
    checkActiveName () {
      let activeName = this.$route.query.type
      if (activeName) {
        this.activeName = activeName
      }
    }
  }
}
</script>

<style lang="less">

</style>
